package com.example.demo.mapper;

import com.example.demo.entity.GoodsImg;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Mr.Xiayh
 * @since 2024-06-04
 */
@Mapper
public interface GoodsImgMapper extends BaseMapper<GoodsImg> {

    @Select("SELECT * FROM goods_img WHERE goods_id = #{goodsId} AND flag = 1")
    List<GoodsImg> selectByGoodsId(Integer goodsId);

    /**
     * 添加商品图片
     * @param path
     * @return
     */
    boolean insertGoodsImg(@Param("goodsId") int goodsId,@Param("path") String path);
}
